package org.springframework.test.properties;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

/**
 * [简要描述]:
 * [详细描述]:
 *
 * @author ZouHaiBo
 * @version 1.0, 2021/7/29 09:38
 * @since JDK 1.8
 */
@Component
public class PropertiesBean implements EnvironmentAware
{

	@Value("${app.name}")
	private String appName;

	@Override
	public void setEnvironment(Environment environment)
	{
		System.out.println(appName);
		System.out.println(environment.getProperty("app.name"));
	}
}
